<template>
    <div>
        <h1 style="text-align: left;">员工五险一金缴纳基数</h1><br>
        
        <el-form :model="formData" ref="form" :rules="rules" label-width="80px" :inline="true" style="display: flex; flex-direction: column; gap: 16px; text-align: left;">
            
            <el-form-item label="">
                
                <el-row :gutter="20" style="width: 100%;">
                    <el-col :span="12" :offset="0">
                        <span>员工姓名</span>
                        <el-input v-model="formData.emp"></el-input>
                        <span>养老保险个人缴纳部分</span>
                        <el-input v-model="formData.pensionInsuranceIndividual"></el-input>
                        <span>医疗保险个人缴纳部分</span>
                        <el-input v-model="formData.healthInsuranceIndividual"></el-input>
                        <span>失业保险个人缴纳部分</span>
                        <el-input v-model="formData.unemploymentInsuranceIndividual"></el-input>
                        <span>生育保险单位缴纳部分</span>
                        <el-input v-model="formData.maternityInsuranceUnit"></el-input>
                        <span>住房公积金个人缴纳部分</span>
                        <el-input v-model="formData.housingProvidentIndividual"></el-input>
                    </el-col>
                    <el-col :span="12" :offset="0">
                        <span>养老保险单位缴纳部分</span>
                        <el-input v-model="formData.pensionInsuranceUnit"></el-input>
                        <span>医疗保险单位缴纳部分</span>
                        <el-input v-model="formData.healthInsuranceUnit"></el-input>
                        <span>失业保险单位缴纳部分</span>
                        <el-input v-model="formData.unemploymentInsuranceUnit"></el-input>
                        <span>工伤保险单位缴纳部分</span>
                        <el-input v-model="formData.compensationInsuranceUnit"></el-input>
                        <span>住房公积金单位缴纳部分</span>
                        <el-input v-model="formData.housingProvidentUnit"></el-input>
                    </el-col>                       
                </el-row>
                
                                
            </el-form-item>
            <el-form-item  style="margin-top: auto; align-self: flex-start;">
                <el-button type="primary" @click="onSubmit">提交</el-button>
                
            </el-form-item>
        </el-form>
        
        
    </div>
</template>

<script setup>
import { ref,defineEmits } from 'vue';
import request from '@/api/request.js'

let emits=defineEmits(['ref-table'])
let props=defineProps(["data"])

let formData = ref({
    ...props.data
})
const onSubmit = () => {
    request({
        url: '/salary/setup/risks/update',
        method: 'put',
        data: formData.value
    }).then(res => {
        emits('ref-table');//刷新列表
    })
}
</script>

<style scoped>

</style>
